{#超欠挖诊断信息修改#}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>修改超欠挖诊断信息</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        body {
            background-color: #f1f3f5;
            font-family: 'Arial', sans-serif;
        }
        .container {
            max-width: 850px;
            margin: 50px auto;
            background: #ffffff;
            border-radius: 10px;
            box-shadow: 0px 6px 15px rgba(0, 0, 0, 0.1);
            padding: 30px;
        }
        h2 {
            color: #007bff;
            font-weight: 700;
            text-align: center;
            margin-bottom: 20px;
        }
        label {
            font-weight: 600;
            color: #343a40;
            margin-bottom: 5px;
            display: block;
        }
        .form-control {
            border-radius: 8px;
            border: 1px solid #ced4da;
            transition: all 0.2s ease-in-out;
        }
        .form-control:focus {
            border-color: #007bff;
            box-shadow: 0px 0px 6px rgba(0, 123, 255, 0.25);
        }
        .form-group {
            margin-bottom: 15px;
        }
        .btn-primary {
            font-size: 16px;
            padding: 10px 20px;
            background: #007bff;
            border-color: #007bff;
            border-radius: 8px;
            transition: all 0.3s ease-in-out;
        }
        .btn-primary:hover {
            background: #0056b3;
            border-color: #004085;
        }
        .btn-secondary {
            font-size: 16px;
            padding: 10px 20px;
            background: #6c757d;
            border-color: #6c757d;
            border-radius: 8px;
            transition: all 0.3s ease-in-out;
        }
        .btn-secondary:hover {
            background: #5a6268;
            border-color: #545b62;
        }
        .error-message {
            color: #dc3545;
            font-size: 13px;
        }
        .alert {
            margin-bottom: 20px;
            border-radius: 8px;
        }
        .form-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 30px;
        }
        .form-footer .btn {
            width: 48%;
        }
        footer {
            margin-top: 30px;
            text-align: center;
            font-size: 14px;
            color: #6c757d;
        }
    </style>
</head>
<body>

<div class="container">
    <h2>修改超欠挖诊断信息</h2>

    <form method="post">
        {% csrf_token %}
        {% if form.errors %}
            <div class="alert alert-danger">
                <strong>请检查以下错误：</strong>
                <ul class="mb-0">
                    {% for field, error in form.errors.items %}
                        <li>{{ field.label }}: {{ error|join:", " }}</li>
                    {% endfor %}
                </ul>
            </div>
        {% endif %}

        <div class="row">
            {% for field in form %}
                {% if field.name != "operation_reason" %} {# 排除掉操作理由字段 #}
                    <div class="col-md-6 form-group">
                        <label for="{{ field.id_for_label }}">{{ field.label }}</label>
                        {{ field }}
                        {% if field.errors %}
                            <div class="error-message">
                                {{ field.errors|join:", " }}
                            </div>
                        {% endif %}
                    </div>
                {% endif %}
            {% endfor %}
        </div>

        <div class="form-footer">
            <button type="submit" class="btn btn-primary">保存修改</button>
            <a href="{% url 'excavation_diagnosis_list' %}" class="btn btn-secondary">返回列表</a>
        </div>
    </form>
</div>

<footer>
    <a href="{% url 'index' %}" class="btn btn-secondary mt-3">返回首页</a>
</footer>

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
